package org.taobao.ibatiside.core.filemodel;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;

public class IbatisConfigFile extends IbatisElement {
	private final IFile configFile;
	
	public int getVersion() {
		return ((IbatisProject)getParent()).getVersion();
	}
	
	public IbatisConfigFile(IFile configFile, IbatisProject project) {
		super();
		this.configFile = configFile;
		setParent(project);
	}

	public IFile getConfigFile() {
		return configFile;
	}
	public IJavaProject getJavaProject(){
		return JavaCore.create(((IbatisProject)getParent()).getProject());
	}
	@Override
	public IResource getResource() {
		return this.configFile;
	}
}
